﻿package view.popup
{
    import com.core.*;
    import com.sh.game.global.*;
    import flash.events.*;
    import uiresource.flying.*;
    import view.*;

    public class FlyingCtrl extends FlyingUI implements IDialogUI
    {

        public function FlyingCtrl()
        {
            return;
        }// end function

        override protected function initialize() : void
        {
            super.initialize();
            vip_txt.label = "购买月卡";
            viptip_txt.text = "使用尊贵月卡 可免费传送!";
            this.listener();
            return;
        }// end function

        private function listener() : void
        {
            close_btn.addEventListener(MouseEvent.CLICK, this.onclose);
            no_btn.addEventListener(MouseEvent.CLICK, this.cancel);
            buy_btn.addEventListener(MouseEvent.CLICK, this.gotobuy);
            vip_txt.addEventListener(MouseEvent.CLICK, this.goingVip);
            return;
        }// end function

        public function show(param1:Object) : void
        {
            this.visible = true;
            item_txt.text = "" + param1;
            x = (GlobalLayer.instance.root.stageWidth - width) / 2;
            y = (GlobalLayer.instance.root.stageHeight - height) / 2;
            return;
        }// end function

        protected function goingVip(event:MouseEvent) : void
        {
            ModelProxy.change("plugin", "open", {target:"viptq"});
            this.close();
            return;
        }// end function

        protected function gotobuy(event:MouseEvent) : void
        {
            DialogMgr.instance.open(AppDialog.SC_BUY, {storeId:131});
            this.close();
            return;
        }// end function

        protected function cancel(event:MouseEvent) : void
        {
            this.close();
            return;
        }// end function

        protected function onclose(event:MouseEvent) : void
        {
            this.close();
            return;
        }// end function

        public function close() : void
        {
            this.visible = false;
            return;
        }// end function

    }
}
